package com.psycho.sys.api.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.psycho.sys.api.entity.Announcement;

import java.util.List;

/**
 * 公告服务接口
 */
public interface AnnouncementService extends IService<Announcement> {
    /**
     * 分页查询公告列表
     */
    Page<Announcement> pageAnnouncements(Integer current, Integer size, String title, Integer type, Integer status);

    /**
     * 创建公告
     */
    boolean createAnnouncement(Announcement announcement);

    /**
     * 更新公告
     */
    boolean updateAnnouncement(Announcement announcement);

    /**
     * 删除公告
     */
    boolean deleteAnnouncement(Long id);

    /**
     * 批量删除公告
     */
    boolean batchDeleteAnnouncements(List<Long> ids);

    /**
     * 更新公告状态
     */
    boolean updateAnnouncementStatus(Long id, Integer status);

    /**
     * 获取最新公告
     */
    List<Announcement> getLatestAnnouncements(Integer limit);

    /**
     * 获取有效公告
     */
    List<Announcement> getActiveAnnouncements(Integer type);
}